<%@page import="com.hamizhong.iflowers.utils.MyConstants"%>
<%@page import="com.hamizhong.iflowers.web.vo.UserVO"%>
<%@page import="java.net.CookieManager"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.cookie.js"></script>


<!-- 判断是否为登录后返回登录页 -->
<%
	String validFlag = (String)session.getAttribute(MyConstants.IFLOWERS_LOGIN_LAST_REQUEST_URI_VALID_FLAG);
	if(validFlag != null && validFlag.equals(MyConstants.IFLOWERS_LOGIN_LAST_REQUEST_URI_VALID_OK)) {
		String lastUri = (String)session.getAttribute(MyConstants.IFLOWERS_LOGIN_LAST_REQUEST_URI);
%>
	<script type="text/javascript">
		location.href = '<%=request.getContextPath() %><%=lastUri %>';
	</script>
<%
	session.setAttribute(MyConstants.IFLOWERS_LOGIN_LAST_REQUEST_URI_VALID_FLAG,MyConstants.IFLOWERS_LOGIN_LAST_REQUEST_URL_VALID_NO);
	}
%>


<style>
a {
	text-decoration: none;
	color: #333333;
}

a:hover {
	text-decoration: underline;
	color: #CC0000;
}

#shortcut {
    height: 31px;
    width: 100%;
}

html, body, div, span, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, address, big, cite, code, del, em, font, img, ins, small, strong, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend {
    margin: 0px;
    padding: 0px;
}

</style>

<script>

function showServiceList() {
	$("#serviceList").show();
}

function hideServiceList() {
	$("#serviceList").hide();
}

</script>

<center>
	<div id="shortcut" style="width: 100%; height: 31px;line-height: 31px;background-image: url('<%=request.getContextPath() %>images/pages/client/h.jpg');">
		<div style="width: 1000px; background: none repeat scroll 0 0 transparent;margin: 0 auto;overflow: hidden;">
			<div style="width: 150px;float: left;text-align: left;line-height: 30px;font-size:12px;color: #333333">
				<img src="<%=request.getContextPath() %>images/pages/client/a.jpg" style="width: 15px;height: 15px;"><a href="#none">收藏Hami鲜花商城</a>
			</div>
			<div style="float: left; margin-left: 100px; width: 450px;">
				<%
					if ((UserVO)request.getSession().getAttribute(MyConstants.IFLOWERS_LOGIN_USER_VO) == null) {
						boolean flagOfUserCookie = false;
						String clientLoginName = null;
						Cookie[] cookie = request.getCookies();
						if(cookie != null) {
							for(int i=0;i<cookie.length;i++) {
								String res = cookie[i].getName();
								if(res.equals(MyConstants.IFLOWERS_LOGIN_USER_COOKIE_NAME)) {
									clientLoginName = cookie[i].getValue();
									flagOfUserCookie = true;
									break;
								}
							}
						}
						if(flagOfUserCookie) {
				%>
							<div style="float: left; color: #ACACAC;height: 26px; line-height: 26px; padding: 2px 0px 3px; font-size: 12px;">
								<%=clientLoginName %>！,欢迎来到Hami鲜花商城！ 
								<span> 
								<a href="<%=request.getContextPath() %>/loginInit.action">[请登录]</a>，新用户？
								<a href="<%=request.getContextPath() %>/registInit.action"style="color: #FF6600">[免费注册]</a> 
								</span>
							</div>
				<%							
						}else {
				%>
							<div style="float: left; color: #ACACAC; height: 26px; line-height: 26px; padding: 2px 0px 3px; font-size: 12px;">
								您好,欢迎来到Hami鲜花商城！ 
								<span> 
									<a href="<%=request.getContextPath() %>/loginInit.action">[请登录]</a>，新用户？ 
									<a href="<%=request.getContextPath() %>/registInit.action" style="color: #FF6600">[免费注册]</a> </span>
							</div>
				<%
						}
					} else {
						UserVO loginUserVO = (UserVO)request.getSession().getAttribute(MyConstants.IFLOWERS_LOGIN_USER_VO);
				%>
				<div style="float: left; color: #ACACAC; height: 26px; line-height: 26px; padding: 2px 0px 3px; font-size: 12px;">
					你好，<font color="green"><%=loginUserVO.getUserName() %></font>！欢迎来到Hami鲜花商城！ <span> <a href="<%=request.getContextPath() %>/doLogout.action">[退出]</a> </span>
				</div>
				<%
					}
				%>
			</div>
			<div style="float: right;text-align: right;width: 250px;">
				<div style="font-size: 12px; width: 60px; float: right; height: 30px;margin-right: 5px;">
					<div onmouseover="showServiceList()" onmouseout="hideServiceList()">
						<div>
							<a href="#none" style="line-height: 31px;">客户服务</a>
						</div>
						<div id="serviceList" style="z-index: 100;width: 70px;border:1px solid gray;line-height: 20px;display: none;padding-left: 3px;" onmouseover="showServiceList()" onmouseout="hideServiceList()">
							<div>
								<a href="#none">常见问题</a>
							</div>
							<div>
								<a href="#none">售后服务</a>
							</div>
							<div>
								<a href="#none">投诉中心</a>
							</div>
							<div>
								<a href="#none">客服邮箱</a>
							</div>
						</div>
					</div>
				</div>
				<div style="width: 60px; float: right; line-height: 31px; font-size: 12px;">
					<a href="<%=request.getContextPath()%>/userCenter.action">个人中心</a>
				</div>
				<div style="width: 80px; float: right;line-height: 31px; font-size: 12px;overflow: hidden;padding-left: 25px;background-image: url('<%=request.getContextPath() %>/images/pages/client/i.jpg');">
					<a href="<%=request.getContextPath()%>/myOrders.action">我的订单</a>
				</div>
			</div>
		</div>
	</div>
</center>